///////////////////////////////////////////////////////////
//  NewCheckListCommand.cpp
//  Implementation of the Class NewCheckListCommand
//  Created on:      21-Sep-2013 12:07:13 PM
//  Original author: Jakkaphan Aiemcharoenjit
///////////////////////////////////////////////////////////

#include "NewCheckListCommand.h"
#include "CurrentCommand.h"

using namespace UI;
using namespace UI::CMD;

NewCheckListCommand::NewCheckListCommand(CCreateCheckListView* createCheckList, CTemplateView* _template)
{
  this->m_type = ICommand::NEWCHECKLIST_CMD;
  this->m_createCheckListView = createCheckList;
  this->m_templateView = _template;
}


NewCheckListCommand::~NewCheckListCommand()
{

}


void NewCheckListCommand::Execute()
{
  this->m_createCheckListView->SetPage(dynamic_cast<IPage*>(m_templateView->GetCurSelected()->Clone()));
  this->m_createCheckListView->Refresh();

  // Set current command
  CurrentCommand::GetInstance()->SetCurrentCommand(this->m_type);
  CurrentCommand::GetInstance()->SetNewOrEditCommand(this->m_type);
}


ICommand::CommandType NewCheckListCommand::GetType()
{
	return this->m_type;
}